home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / ct_ocx / ct_tabs.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-12-30  |  10.2 KB  |  331 lines

  1. VERSION 4.00
  2. Begin VB.Form w_tabs_demo 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "ctTABS (Page Tabs) Demo"
  6.    ClientHeight    =   5250
  7.    ClientLeft      =   1815
  8.    ClientTop       =   2085
  9.    ClientWidth     =   7725
  10.    Height          =   5655
  11.    Icon            =   "ct_tabs.frx":0000
  12.    Left            =   1755
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MDIChild        =   -1  'True
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   5250
  18.    ScaleWidth      =   7725
  19.    ShowInTaskbar   =   0   'False
  20.    Top             =   1740
  21.    Width           =   7845
  22.    Begin VB.CommandButton Command1 
  23.       Caption         =   "E&xit"
  24.       Height          =   375
  25.       Left            =   6420
  26.       TabIndex        =   5
  27.       Top             =   4770
  28.       Width           =   1035
  29.    End
  30.    Begin VB.HScrollBar scrBar 
  31.       Height          =   285
  32.       Left            =   4800
  33.       Max             =   11
  34.       Min             =   1
  35.       TabIndex        =   3
  36.       Top             =   4140
  37.       Value           =   1
  38.       Width           =   2055
  39.    End
  40.    Begin VB.Label lbl_cap 
  41.       Caption         =   "A-B"
  42.       BeginProperty Font 
  43.          name            =   "Times New Roman"
  44.          charset         =   0
  45.          weight          =   400
  46.          size            =   21.75
  47.          underline       =   0   'False
  48.          italic          =   0   'False
  49.          strikethrough   =   0   'False
  50.       EndProperty
  51.       Height          =   465
  52.       Left            =   5940
  53.       TabIndex        =   14
  54.       Top             =   1350
  55.       Width           =   975
  56.    End
  57.    Begin VB.Label Label8 
  58.       BorderStyle     =   1  'Fixed Single
  59.       Height          =   375
  60.       Left            =   5280
  61.       TabIndex        =   13
  62.       Top             =   3330
  63.       Width           =   1395
  64.    End
  65.    Begin VB.Label Label7 
  66.       BorderStyle     =   1  'Fixed Single
  67.       Height          =   375
  68.       Left            =   900
  69.       TabIndex        =   12
  70.       Top             =   3330
  71.       Width           =   4395
  72.    End
  73.    Begin VB.Label Label6 
  74.       BorderStyle     =   1  'Fixed Single
  75.       Height          =   375
  76.       Left            =   5280
  77.       TabIndex        =   11
  78.       Top             =   2970
  79.       Width           =   1395
  80.    End
  81.    Begin VB.Label Label5 
  82.       BorderStyle     =   1  'Fixed Single
  83.       Height          =   375
  84.       Left            =   900
  85.       TabIndex        =   10
  86.       Top             =   2970
  87.       Width           =   4395
  88.    End
  89.    Begin VB.Label Label4 
  90.       BorderStyle     =   1  'Fixed Single
  91.       Height          =   375
  92.       Left            =   5280
  93.       TabIndex        =   9
  94.       Top             =   2610
  95.       Width           =   1395
  96.    End
  97.    Begin VB.Label Label2 
  98.       BorderStyle     =   1  'Fixed Single
  99.       Height          =   375
  100.       Left            =   5280
  101.       TabIndex        =   8
  102.       Top             =   2250
  103.       Width           =   1395
  104.    End
  105.    Begin VB.Label Label3 
  106.       BorderStyle     =   1  'Fixed Single
  107.       Height          =   375
  108.       Left            =   900
  109.       TabIndex        =   7
  110.       Top             =   2610
  111.       Width           =   4395
  112.    End
  113.    Begin VB.Label Label1 
  114.       BorderStyle     =   1  'Fixed Single
  115.       Height          =   375
  116.       Left            =   900
  117.       TabIndex        =   6
  118.       Top             =   2250
  119.       Width           =   4395
  120.    End
  121.    Begin VB.Label LabelBottom 
  122.       Caption         =   "Click on the tabs or scroll bar to change the directory."
  123.       BeginProperty Font 
  124.          name            =   "MS Sans Serif"
  125.          charset         =   0
  126.          weight          =   700
  127.          size            =   8.25
  128.          underline       =   0   'False
  129.          italic          =   0   'False
  130.          strikethrough   =   0   'False
  131.       EndProperty
  132.       ForeColor       =   &H00800000&
  133.       Height          =   285
  134.       Left            =   900
  135.       TabIndex        =   4
  136.       Top             =   4680
  137.       Width           =   4695
  138.    End
  139.    Begin TabsLib.ctTabs ct_Tabs 
  140.       Height          =   285
  141.       Left            =   780
  142.       TabIndex        =   2
  143.       Top             =   4140
  144.       Width           =   4035
  145.       _version        =   65536
  146.       _extentx        =   7117
  147.       _extenty        =   503
  148.       _stockprops     =   70
  149.       caption         =   "A-B;C-D;E-F;G-H;I-K;L-M;N-O;P-R;S-T;U-V;W-Z"
  150.       BeginProperty font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  151.          name            =   "Arial"
  152.          charset         =   0
  153.          weight          =   700
  154.          size            =   8.25
  155.          underline       =   0   'False
  156.          italic          =   0   'False
  157.          strikethrough   =   0   'False
  158.       EndProperty
  159.       amount          =   11
  160.       distanceapart   =   44
  161.       tabwidth        =   55
  162.       selectedstyle   =   0
  163.       backcolor       =   12632256
  164.       tabcolor        =   14745599
  165.       tabbackcolor    =   14745599
  166.       tabtextcolor    =   0
  167.       threed          =   -1  'True
  168.       BeginProperty selectedfont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  169.          name            =   "Times New Roman"
  170.          charset         =   0
  171.          weight          =   700
  172.          size            =   9.75
  173.          underline       =   0   'False
  174.          italic          =   0   'False
  175.          strikethrough   =   0   'False
  176.       EndProperty
  177.    End
  178.    Begin VB.Label LabelDir 
  179.       Caption         =   "Telephone Directory"
  180.       BeginProperty Font 
  181.          name            =   "Times New Roman"
  182.          charset         =   0
  183.          weight          =   400
  184.          size            =   24
  185.          underline       =   0   'False
  186.          italic          =   0   'False
  187.          strikethrough   =   0   'False
  188.       EndProperty
  189.       ForeColor       =   &H00800000&
  190.       Height          =   555
  191.       Left            =   720
  192.       TabIndex        =   1
  193.       Top             =   1260
  194.       Width           =   4515
  195.    End
  196.    Begin VB.Shape Shape1 
  197.       BorderWidth     =   2
  198.       Height          =   3090
  199.       Left            =   420
  200.       Shape           =   4  'Rounded Rectangle
  201.       Top             =   1080
  202.       Width           =   6855
  203.    End
  204.    Begin VB.Label Labeltitle 
  205.       Alignment       =   2  'Center
  206.       Caption         =   $"ct_tabs.frx":030A
  207.       BeginProperty Font 
  208.          name            =   "MS Sans Serif"
  209.          charset         =   0
  210.          weight          =   700
  211.          size            =   8.25
  212.          underline       =   0   'False
  213.          italic          =   0   'False
  214.          strikethrough   =   0   'False
  215.       EndProperty
  216.       ForeColor       =   &H00800000&
  217.       Height          =   465
  218.       Left            =   180
  219.       TabIndex        =   0
  220.       Top             =   270
  221.       Width           =   7335
  222.    End
  223. Attribute VB_Name = "w_tabs_demo"
  224. Attribute VB_Creatable = False
  225. Attribute VB_Exposed = False
  226. Private Sub Command1_Click()
  227.    Unload w_tabs_demo
  228. End Sub
  229. Private Sub ct_Tabs_DrawTab(nDrawTab As Integer)
  230.    If (nDrawTab = 5 Or nDrawTab = 11) Then
  231.       ct_Tabs.TabTextColor = RGB(128, 128, 128)
  232.    End If
  233. End Sub
  234. Private Sub ct_Tabs_TabChange(nNewTab As Integer, nOldTab As Integer)
  235.    scrBar.Value = nNewTab
  236.    Label1.Caption = ""
  237.    Label2.Caption = ""
  238.    Label3.Caption = ""
  239.    Label4.Caption = ""
  240.    Label5.Caption = ""
  241.    Label6.Caption = ""
  242.    label7.Caption = ""
  243.    label8.Caption = ""
  244.    Select Case (nNewTab)
  245.    Case 1
  246.       lbl_cap.Caption = "A-B"
  247.       Label1.Caption = "Abott, Bud"
  248.       Label2.Caption = "840-8338"
  249.       Label3.Caption = "Aaron, Lee"
  250.       Label4.Caption = "744-1233"
  251.       Label5.Caption = "Budinsky, Lou"
  252.       Label6.Caption = "232-4774"
  253.    Case 2
  254.       lbl_cap.Caption = "C-D"
  255.       Label1.Caption = "Crane, Fraser"
  256.       Label2.Caption = "477-5855"
  257.       Label3.Caption = "Dreary, Dave"
  258.       Label4.Caption = "212-4485"
  259.    Case 3
  260.       lbl_cap.Caption = "E-F"
  261.       Label1.Caption = "Errin, Joe"
  262.       Label2.Caption = "222-8338"
  263.       Label3.Caption = "Foley, Axel"
  264.       Label4.Caption = "923-9233"
  265.       Label5.Caption = "Frame, P."
  266.       Label6.Caption = "947-3773"
  267.    Case 4
  268.       lbl_cap.Caption = "G-H"
  269.       Label1.Caption = "Gluck, Craig"
  270.       Label2.Caption = "475-7903"
  271.    Case 5
  272.       lbl_cap.Caption = "I-K"
  273.    Case 6
  274.       lbl_cap.Caption = "L-M"
  275.       Label1.Caption = "Larry, Moe"
  276.       Label2.Caption = "857-4464"
  277.       Label3.Caption = "Manny, May"
  278.       Label4.Caption = "1-844-4833"
  279.       Label5.Caption = "Moriarty, P."
  280.       Label6.Caption = "887-8447"
  281.    Case 7
  282.       lbl_cap.Caption = "N-O"
  283.       Label1.Caption = "Neville, Aaron"
  284.       Label2.Caption = "233-3833"
  285.       Label3.Caption = "Osterman, al"
  286.       Label4.Caption = "888-8838"
  287.    Case 8
  288.       lbl_cap.Caption = "P-R"
  289.       Label1.Caption = "Porter, Cole"
  290.       Label2.Caption = "874-2273"
  291.       Label3.Caption = "Radison, George"
  292.       Label4.Caption = "733-4484"
  293.       Label5.Caption = "Rickson, Bob."
  294.       Label6.Caption = "393-8338"
  295.    Case 9
  296.       lbl_cap.Caption = "S-T"
  297.       Label1.Caption = "Sargeant, Dick"
  298.       Label2.Caption = "744-8555"
  299.       Label3.Caption = "Teller, Pen"
  300.       Label4.Caption = "885-6955"
  301.    Case 10
  302.       lbl_cap.Caption = "U-V"
  303.       Label1.Caption = "Unger, Felix"
  304.       Label2.Caption = "274-1273"
  305.    Case 11
  306.       lbl_cap.Caption = "W-Z"
  307.    End Select
  308. End Sub
  309. Private Sub Form_Load()
  310.    ' Center the window on the screen
  311.    Move (Screen.Width - Width) / 2, (Screen.Height - Height) * 0.15
  312. End Sub
  313. Private Sub scrBar_Change()
  314.    Dim Visible As Integer
  315.    Dim Cntr As Integer
  316.    Visible = 6
  317.    If (ct_Tabs.SelectedTab < scrBar.Value) Then
  318.       ct_Tabs.SelectedTab = scrBar.Value
  319.       If (ct_Tabs.SelectedTab - ct_Tabs.Offset > Visible) Then
  320.          ct_Tabs.Offset = ct_Tabs.SelectedTab - Visible
  321.       End If
  322.    Else
  323.       If (ct_Tabs.SelectedTab > scrBar.Value) Then
  324.          ct_Tabs.SelectedTab = scrBar.Value
  325.          If (ct_Tabs.SelectedTab <= ct_Tabs.Offset) Then
  326.             ct_Tabs.Offset = ct_Tabs.SelectedTab - 1
  327.          End If
  328.       End If
  329.    End If
  330. End Sub
  331.